package cn.mw.cmdb.controller;

import cn.mw.microMonitorCommon.api.common.BaseApiService;
import cn.mw.microMonitorCommon.api.common.ResponseBase;
import cn.mw.scanengine.param.ScanEngineParam;
import cn.mw.scanengine.service.ScanEngineService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@RequestMapping("/scanManage")
@Controller
@Tag(name = "扫描管理")
@Slf4j
public class ScanEngineController extends BaseApiService {

    private ScanEngineService scanEngineService;

    public ScanEngineController(ScanEngineService scanEngineService){
        this.scanEngineService = scanEngineService;
    }

    @PostMapping("/listEngine")
    @ResponseBody
    @Operation(summary = "引擎列表")
    public ResponseBase listEngine(@RequestBody ScanEngineParam scanEngineParam) throws Exception{
        List list = scanEngineService.listScanEngine(scanEngineParam);
        return setResultSuccess(list);
    }
}
